package GUI;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Toolkit;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JTextField;

import CommonGui.Translate;

public class VKBLettersAndDigitsPopUp extends JDialog  {
	
	private JPanel mainPanel;
	private JPanel panel1;
	private JPanel panel2;
	private JPanel panel3;
	private JPanel panel4;
	private JPanel panel5;
	private JPanel panel6;
	private Color color;
	public Translate T;
	private Dimension screenSize;
	private int x;
	private int y;
	

		 public VKBLettersAndDigitsPopUp()
		 {
			super();
			screenSize = Toolkit.getDefaultToolkit().getScreenSize();
			x=screenSize.width;
			y=screenSize.height;
			this.setFocusableWindowState(false);
			setBackground(new Color(210, 180, 140));		
			T=new Translate();
			mainPanel.setLayout(new GridLayout(5, 1,0,0));
			initialize();
		 }
		 
		 public VKBLettersAndDigitsPopUp(Color c)
		 {
			super();
			screenSize = Toolkit.getDefaultToolkit().getScreenSize();
			x=screenSize.width;
			y=screenSize.height;
			this.setFocusableWindowState(false);
			setBackground(new Color(210, 180, 140));		
			T=new Translate(c);
			mainPanel=new JPanel();
			//mainPanel.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
			mainPanel.setLayout(new GridLayout(5, 1,0,0));
			initialize();
			this.add(mainPanel);
		 }
		 


			private void initialize()
			{
				
			T.st=new String("");
			T.TextField=new JTextField();
			T.key=new JButton[100];
			T.TextField.setPreferredSize(new Dimension(300,60));
			T.CAPS=1;
			T.init();
			
			panel1=new JPanel();
			panel1.setBackground(new Color(210, 180, 140));
			panel1.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
			for(int i=0;i<13;i++)
				
			{	
				T.key[i].setPreferredSize(new Dimension(x/35,y/25));
				T.key[i].setFont(new Font("Tahoma", Font.BOLD, x/120));
				panel1.add(T.key[i]);
				
			}
			
			T.key[13].setPreferredSize(new Dimension(x/18,y/25));
			T.key[13].setFont(new Font("Tahoma", Font.BOLD, x/120));
			panel1.add(T.key[13]);
			mainPanel.add(panel1);
			
			
			
			
			
			
			
		
			panel2=new JPanel();
			panel2.setBackground(new Color(210, 180, 140));
			panel2.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
		    for(int i=0;i<12;i++)			
			{	
				T.key[i+14].setPreferredSize(new Dimension(x/35,y/25));
				T.key[i+14].setFont(new Font("Tahoma", Font.BOLD, x/120));
				panel2.add(T.key[i+14]);			
			}
		    mainPanel.add(panel2);
		
		
		
		
		
		
		
		
		
		panel3=new JPanel();
		panel3.setBackground(new Color(210, 180, 140));
		panel3.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
		for(int i=0;i<12;i++)		
		{	
			T.key[i+14+12].setPreferredSize(new Dimension(x/35,y/25));
			T.key[i+14+12].setFont(new Font("Tahoma", Font.BOLD, x/120));
			panel3.add(T.key[i+14+12]);		
		}
		mainPanel.add(panel3);
		
		
		
		
		
		
		
		panel4=new JPanel();
		panel4.setBackground(new Color(210, 180, 140));
		panel4.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));
	    for(int i=0;i<10;i++)		
		{	
			T.key[i+14+12+12].setPreferredSize(new Dimension(x/35,y/25));
			T.key[i+14+12+12].setFont(new Font("Tahoma", Font.BOLD, x/120));
			panel4.add(T.key[i+14+12+12]);		
		}

	    mainPanel.add(panel4);



	    
	    
	    

		panel5=new JPanel();
		panel5.setBackground(new Color(210, 180, 140));
		panel5.setLayout(new FlowLayout(FlowLayout.CENTER, 5,5 ));	
		for(int i=0;i<3;i++)		
		{	
			T.key[i+14+12+12+10].setPreferredSize(new Dimension(x/17,y/25));
			T.key[i+14+12+12+10].setFont(new Font("Tahoma", Font.BOLD, x/120));
			panel5.add(T.key[i+14+12+12+10]);	
		}	
		mainPanel.add(panel5);
			
			
		      setVisible(true);
		      if (T.TextField!=null)
		       T.listen();
		}

			



	}
